<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //创建伪数组
        const fruits = {
            0 : 'apple',
            1 : 'pear',
            2 : 'banana',
            length: 3,
        }
        console.log(fruits[2])
        console.log(fruits.length)
        console.log(fruits)

        //伪数组转真数组
        //1、[...argumens] 要求有迭代器接口（Symbol.iterator）
        //2、Array.from(伪数组)
        console.log(Array.from(fruits))
        //3、通过数组的slice方式实现  Array.prototype.slice.call(伪数组)
        console.log( Array.prototype.slice.call(fruits))
    </script>
</body>
</html>